home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / tutor / pcl61a.arj / PART2.EXE / DOSTIPS.TUT < prev    next >
Text File  |  1993-08-16  |  36KB  |  786 lines

  1.        
  2.        The following information is reprinted with permission, Ultimate 
  3.        Power Tips 1.0A (c) 1992, 1993  Paul Scanlon, Scanlon Enterprises 
  4.        
  5.        ------------------------------------------------------------
  6.  
  7.                                  DOS POWER TIPS
  8.  
  9.        ------------------------------------------------------------
  10.  
  11.        Smoother DOS
  12.  
  13.        Users tend to clump many files into the ROOT directory of the 
  14.        boot drive (usually C:). Not only does this slow DOS down, but 
  15.        it could be the potential for some real problems. On floppies, 
  16.        there is a limit of 112 files for a root directory. This means, 
  17.        that when there are 112 files, DOS will give an error report, of 
  18.        "unable to create file" on the next attempt to create a file, 
  19.        even temporary files, which many word processors need. In fact, 
  20.        there are many applications which create temporary files in the 
  21.        root directory. If you keep adding files to the root (other than 
  22.        these temporary ones), then eventually, the application itself 
  23.        will fail! I suggest, as an experienced consultant, that you 
  24.        create and maintain several directories, including layered ones. 
  25.  
  26.         For instance, ALL DOS programs, should go into a directory 
  27.         called DOS, just off the root. The only files DOS needs in the 
  28.         root at boot time, are COMMAND.COM and CONFIG.SYS ! Everything 
  29.         else, including your mouse drive and ANSI.SYS should be in a 
  30.         directory. Another directory you should create, is one called 
  31.         BAT (or BATCH), where you should place all those short batch 
  32.         files (they don't belong in the root directory). There is only 
  33.         one batch file which should be in the root, and that is 
  34.         AUTOEXEC.BAT.
  35.  
  36.        What of layered directories? If like me, you collect utilities, 
  37.        then you should keep those most often used in one directory and 
  38.        the rest in another, and NOT in the root directory. A layered 
  39.        directory is one which is inside another. For instance, on my 
  40.        machine, I created a directory called UTILS, which itself 
  41.        contains other directory names. Inside UTILS, I created 
  42.        directories with names of L1, L2, L3, etc... and each one has 
  43.        utilities, which are of lesser and lesser importance, with L1 
  44.        containing the most often used. 
  45.  
  46.        Why this struggle to remove files from the root and use of 
  47.        layered directories? Because, DOS must search for whatever you 
  48.        type at a DOS prompt, or what is requested from a batch file. 
  49.        DOS will search a 10 entry directory faster than a 100 entry 
  50.        directory! You WILL notice this extra speed! The layered 
  51.        directories adds to this approach. When you made your AUTOEXEC 
  52.        batch file, you added a line starting with "PATH=", which 
  53.        contains the search string for DOS. This search string tells DOS 
  54.        where to begin looking for executable programs, after checking 
  55.        the current directory. For this reason, I place my DOS directory 
  56.        as the first search entry like this : PATH=C:\DOS 
  57.  
  58.        If all of your executables were in this one directory, that 
  59.        would be all you needed! This would be the case for small hard 
  60.        drives, such as the old 10MB and 20MB drives. This is NOT the 
  61.        case for systems with dozens of applications, which can be 
  62.        executed from any DOS prompt. In my case, for example, I created 
  63.        the extra utility directories inside a main directory called 
  64.        UTILS, with the names of L1, L2, L3, etc.. In this case, my PATH 
  65.        statement, in my AUTOEXEC has the following PATH statement: 
  66.  
  67.                 PATH=C:\DOS;C:\UTILS\L1;C:\UTILS\L2;C:\UTILS\L3
  68.  
  69.        Prefix the path, with a drive letter, because, we might be on 
  70.        drive A or B when we request a utility or DOS function. Notice 
  71.        the semicolon between entries. DOS requires these to delimit one 
  72.        path entry from another. A well designed hard drive, will have 
  73.        less than 20 entries in the root directory! 
  74.  
  75.        
  76.         Easy Disk Transfer
  77.  
  78.         Add the following two batch files to your system to make copying 
  79.         files from drive A to your hard drive easy. The batch file 
  80.         TOA.BAT copies selected (or all) files to drive A, while the 
  81.         batch file FROMA.BAT copies selected (or all) files from drive 
  82.         A. By using these two batch files, you can avoid have to retype 
  83.         and retype the DOS COPY command.
  84.  
  85.                 TOA.BAT
  86.  
  87.                 REM ------------------
  88.                 REM -   TOA.BAT      -
  89.                 REM ------------------
  90.                 REM Copy several files to drive A:
  91.                 ECHO OFF
  92.                 IF NOT %1* == * GOTO LPB
  93.                 COPY *.* A:
  94.                 :LPA
  95.                 SHIFT
  96.                 :LPB
  97.                 IF %1* == * GOTO XIT
  98.  
  99.                 COPY %1 A:
  100.                 GOTO LPA
  101.                 :XIT
  102.                 REM End of batch file
  103.  
  104.                 FROMA.BAT
  105.  
  106.                 REM -------------------
  107.                 REM -   FROMA.BAT     -
  108.                 REM -------------------
  109.                 REM Copy several files from drive A:
  110.                 ECHO OFF
  111.                 IF NOT %1* == * GOTO LPB
  112.                 COPY A:*.*
  113.                 :LPA
  114.                 SHIFT
  115.                 :LPB
  116.                 IF %1* == * GOTO XIT
  117.                 COPY A:%1
  118.                 GOTO LPA
  119.                 :XIT
  120.                 REM End of batch file
  121.  
  122.         Now, if you want to copy, for example, 3 files to drive A:, 
  123.         called MYF1, MYF2 & MYF3 you simply enter :
  124.  
  125.                 TOA MYF1 MYF2 MYF3
  126.  
  127.         If the same files were on A: and you wanted them on C: you'd 
  128.         enter this :
  129.  
  130.                 FROMA MYF1 MYF2 MYF3
  131.  
  132.         These batch files examples can easily be modified to include 
  133.         other drives, such as B: or D: !
  134.  
  135.  
  136.  
  137.         Batch File, Know Thy Self
  138.  
  139.         Do you have a batch file which must be run on drive A: only, 
  140.         such as an INSTALL.BAT file? Add these few lines to your batch 
  141.         file, and it will know if it is running on drive A: (Assume the 
  142.         batch file name is INSTALL.BAT).
  143.  
  144.                 IF NOT %0 == A:INSTALL.BAT GOTO DRVERR
  145.                 {Your batch file commands}
  146.                 GOTO XIT
  147.                 :DRVERR
  148.                 ECHO You must start this batch file from drive A:
  149.                 :XIT
  150.  
  151.         DOS sets batch file %0 equal to the path (including drive) and 
  152.         file name of the current running batch file.
  153.  
  154.  
  155.  
  156.         The Invisible DOS TYPE Command
  157.  
  158.         DOS has several built in commands, one of which is the COPY 
  159.         command. This is normally used, to transfer files from one disk 
  160.         to another. This remarkable utility can also, display or print a 
  161.         file. To print a file, simply use the following:
  162.  
  163.                 COPY filename PRN
  164.  
  165.  
  166.         Where "filename" is any valid DOS file name, which may include 
  167.         drive and path. Alternately, you may substitute LPTn for PRN, 
  168.         where "n" is in the range of 1 - 4 on PC compatible machines and 
  169.         1 - 9 on PS/2 compatible machines. To display a file, simply 
  170.         enter the following :
  171.  
  172.                 COPY filename CON
  173.  
  174.         Where "filename" is the same as above. You will have to be quick 
  175.         to stop the scrolling, as it will scroll off screen, if you do 
  176.         NOT use the PAUSE key to halt it. The advantage of using this 
  177.         approach for printing, is that the DOS redirector ">" does NOT 
  178.         have to be used, as when using the TYPE command, IE.. TYPE 
  179.         filename > PRN . Another advantage of using COPY, is that if you 
  180.         are on a strange machine, and it doesn't have TYPE.COM anywhere 
  181.         around, then you can use COPY as it's a built in DOS function, 
  182.         and does NOT require an external program to execute.
  183.  
  184.  
  185.  
  186.         Use Your Computer as a Typewriter
  187.  
  188.         To type directly from the keyboard to a printer, a quick yet 
  189.         easy way is to use "COPY CON PRN". This is entered directly from 
  190.         a DOS prompt. You won't have word wrap, or other wordprocessor 
  191.         features, but you can correct any text entered on the current 
  192.         line. You simply enter a line of text, and press {Enter} after 
  193.         assuring that the line is correct. Once entered the last line to 
  194.         send to the printer, hold the Control key down and press the "Z" 
  195.         key. Release both keys and press {Enter}. Everything that you 
  196.         have typed will be printed on your printer.
  197.  
  198.  
  199.  
  200.         Protecting System Files From Accidental Deletion
  201.  
  202.         You're working in an application directory on your hard disk 
  203.         with a job running longer than expected. So you decide to make 
  204.         room on a recycled floppy to copy files and finish the project 
  205.         at home. You type "DIR A:" and see that you no longer need the 
  206.         data on the floppy disk, but then you type "DEL *.*", and when 
  207.         DOS asks "Are You Sure (Y/N) ?", you answer "Y", erasing all the 
  208.         files in your application directory! Protect yourself from this 
  209.         type of accidental erasure, by using the DOS command "ATTRIB +R 
  210.         *.*" to make all files in your applications directory read-only. 
  211.         You can un-protect individual files that require regular 
  212.         updating (personal dictionaries and so on) by typing "ATTRIB -R 
  213.         filename".
  214.  
  215.  
  216.  
  217.         Easy On-Line Reminders
  218.  
  219.         If you can't always remember short but complex procedures and 
  220.         command sequences (printer setup codes and the like), jog your 
  221.         memory with brief, on-line ASCII how-to files created with your 
  222.         text editor or word processor. Format the files so that they're 
  223.         easily readable in a single screen. Give them names you'll have 
  224.         no trouble remembering, and store them in a directory call 
  225.         "\HELP". Then add a batch file called "HELP.BAT", which contains 
  226.         the line "TYPE \HELP\%1", to your batch file directory, which is 
  227.         contained in the PATH statement, of your AUTOEXEC.BAT file. When 
  228.         you need assistance, use the DOS command "HELP filename" to get 
  229.         an instant refresher course.
  230.  
  231.  
  232.  
  233.         Determining Your Rom Bios Date
  234.  
  235.         If you are experiencing problems with a hardware upgrade, you 
  236.         can use the DEBUG utility (which came on one of your DOS disks) 
  237.         to check the date of your computer's Rom Bios. Run DEBUG, and at 
  238.         the hyphen "-" prompt type DFFFF:5 L8 and press {Enter}. Your 
  239.         system's Rom Bios Date will appear on the right side of your 
  240.         screen. Press Q then {Enter} to return to a DOS prompt.
  241.  
  242.  
  243.  
  244.         A Quicker Exit
  245.  
  246.         If you frequently shell out of applications or an environment, 
  247.         you probably  get plenty of practice typing "EXIT" and pressing 
  248.         {Enter} to return to the application. You can save yourself some 
  249.         keystrokes by creating a batch file called E.BAT that contains 
  250.         the line "EXIT". This batch file should be in a directory listed 
  251.         in the PATH of your system.
  252.  
  253.  
  254.  
  255.         The Shell in the Shell
  256.  
  257.         If the WordPerfect Library shell loads inside of itself, you DOS 
  258.         prompt will read something like "(SHELL)(SHELL)C::>", and {F7} 
  259.         won't bring back the Library screen. To solve the problem, type 
  260.         EXIT and press {Enter}, then press {F7} at the Library screen, 
  261.         repeating the process until your prompt has only one "(SHELL)". 
  262.         To avoid the problem, regularly use {F7} rather than the SHELL 
  263.         command to return to the Library.
  264.  
  265.  
  266.  
  267.         Where's That Ram
  268.  
  269.         More and more VGA Boards are sporting 512K or more of Ram. But 
  270.         if you check video RAM with the current version of most programs 
  271.         like Chekit, System Sleuth or Norton Utils, they show up to 256K 
  272.         only. Not to worry, the additional Ram is really there, but the 
  273.         BIOS calls (standard) do not yet support for video ram sizes 
  274.         greater than 256K.
  275.  
  276.  
  277.  
  278.         DOS FILES, BUFFERS, CONFIG.SYS commands
  279.  
  280.        The CONFIG.SYS file, MUST be located in the ROOT directory of 
  281.        the boot drive. This file, contains commands to set some DOS 
  282.        resources plus installation of Device Drivers, such as that for 
  283.        the Mouse. By default, DOS reserves small portions of memory to 
  284.        use, to track and manage a number of disk drives, open files, 
  285.        standard devices such as the video and keyboard, and disk data 
  286.        buffers. The FILES command lets you increase the maximum number 
  287.        of simultaneously open files, a necessity of modern applications 
  288.        that open multiple data, index or internal utility (such as a 
  289.        spelling checker) files. 
  290.        
  291.        In DOS versions prior to 3.3, FILES could NOT be set greater 
  292.        than 20! With newer DOS versions, we can now set FILES to as 
  293.        high as 255! BUFFERS, is a command to enable a selected number 
  294.        of disk buffers, DOS's built in disk cache system. The larger 
  295.        the number of Buffers, the more disk cache available to DOS, and 
  296.        the less memory available to your application program. The ideal 
  297.        setting for FILES, depends on the applications you are running. 
  298.        Many applications, upon installation, modify the CONFIG.SYS file 
  299.        to make FILES the correct size for that application. Other 
  300.        applications, simply warn the user to have FILES set to the 
  301.        correct value. Find the application requesting the largest 
  302.        number of FILES and set FILES to that number, plus 2, for each 
  303.        TSR you may have, which access files. IE.. your word processor 
  304.        wants 20, and you have 3 TSR programs running that access files, 
  305.        then set FILES=26 in your CONFIG.SYS file. If you are running 
  306.        DOS versions prior to 3.3, there are some Shareware utilities 
  307.        which can set the max FILES to larger than the DOS limit of 20!  
  308.        The BUFFERS command sets up the DOS internal buffers, which hold 
  309.        copies of recent disk I/O. 
  310.        
  311.        Whenever an application wants to read or write data to a disk, 
  312.        DOS first checks the disk buffers to see if the requested data 
  313.        is there. If the data is, then disk I/O is NOT necessary. This 
  314.        speeds up your application.  Of course, having too many BUFFERS 
  315.        can slow things down, as this would mean more searching. The 
  316.        optimum number of BUFFERS depends in part upon the 
  317.        characteristics and types of drives on you system, the 
  318.        application types and  number of directories and sub-
  319.        directories. For example, having a large number of buffers does 
  320.        NOT improve performance of applications that access files 
  321.        sequentially, but can dramatically reduce the execution time of 
  322.        programs that access files randomly, especially files with small 
  323.        record sizes, such as an index file. Increasing BUFFERS is also 
  324.        useful for systems with layered directories (several layers). If 
  325.        you are, however, using a disk cache system, then you should set 
  326.        BUFFERS=1 (see your cache system manual). 
  327.  
  328.  
  329.  
  330.         ATTRIB to the Rescue!
  331.  
  332.         You can find files with the DOS ATTRIB command just as easily as 
  333.         using the program WHEREIS! Simply enter "ATTRIB *.TXT /S" will 
  334.         find all TXT extension files, listing them to the display. Want 
  335.         a listing ? Then use "ATTRIB *.TXT /S>TXT.LST" will put the 
  336.         listing into the file "TXT.LST".
  337.  
  338.         Another useful use of ATTRIB, is to force programs which will 
  339.         not accept will cards, to perform their task over a range of 
  340.         several files, without having to enter each one manually. We can 
  341.         do this across directories. First, we must set the archive bit 
  342.         on all files we want to perform a task on. Do this with the 
  343.         command "ATTRIB +A *.TXT /S". Next, rename the program that you 
  344.         want to operate on all the selected files, in our example, we 
  345.         will use POWER.COM, to A.extension (our example is A.COM). Now, 
  346.         use attrib to make a batch file, like so, "ATTRIB *.TXT 
  347.         /S>OPT.BAT". The batch file thus created, will contain a list of 
  348.         each TXT extension file, preceded by A, such as "A 
  349.         C:\MYTXT.TXT". Now executing the batch file will cause our 
  350.         program POWER.COM, renamed to A.COM, to operate on all TXT 
  351.         extension files!
  352.  
  353.  
  354.  
  355.         A Different DOS Backup System, for FREE
  356.  
  357.         You can use the DOS ATTRIB and XCOPY to make a very powerful 
  358.         back up system. The DOS BACKUP command, is know as having many 
  359.         bugs and restore problems, especially if restoring between DOS 
  360.         versions. To back up your system for the first time, use the 
  361.         following ATTRIB command line.
  362.  
  363.                 ATTRIB +A *.* /S
  364.  
  365.         This will SET all file archive flags, in all directories of the 
  366.         current drive. We can now begin the backing up all files. First, 
  367.         have a stack of formatted disks ready for you backup. For 40 
  368.         megabytes of data, you will need; 110 360K disks, 33 1.2Meg 
  369.         disks, 55 720K disks or 28 1.44meg disks. Now, at your DOS 
  370.         prompt, enter the following command line.
  371.  
  372.                 XCOPY *.* A: /A /S /E
  373.  
  374.         This will fill the first disk and exit with a "Disk Full" 
  375.         message. Simply ignore the error, and replace the full disk, 
  376.         with an empty one, press the [F3] key to duplicate the previous 
  377.         command (or retype it), and repeat this process, until there are 
  378.         no files to copy. After making this initial set, you will only 
  379.         need to back up new or modified files. Doing this, simply 
  380.         requires you to have enough formatted disk ready to copy the new 
  381.         data (usually one disk is enough). Now type the line beginning 
  382.         with "XCOPY" from above, and all NEW files will be cloned on 
  383.         your disk. Using this process, also makes the directories on the 
  384.         floppy as it goes, including empty ones. The only draw back to 
  385.         this method, is attempting to back up files larger than the 
  386.         selected disk size. IE... a 360K disk will only hold a file up 
  387.         to 360K in size.
  388.  
  389.        
  390.         Stop Struggling With The DOS Format Command
  391.  
  392.         Do you often format different density disks in the same drive? 
  393.         Here is a quick batch file, which will save you keystrokes.
  394.  
  395.         @ECHO OFF
  396.         REM FORMAT.BAT
  397.         REM RENAME THE DOS FORMAT.COM TO FORMAT!.COM
  398.         GOTO %1
  399.         :HELP
  400.         ECHO You must specify the type of disk you want to format
  401.         ECHO FORMAT 360 will format a 360K disk in drive A:
  402.         ECHO FORMAT 12 will format a 1.2MB disk in drive A:
  403.         ECHO FORMAT 720 will format a 720K disk in drive B:
  404.         ECHO FORMAT 144 will format a 1.44MB disk in drive B:
  405.         ECHO Do NOT include the drive letter
  406.         ECHO Other FORMAT options are OK
  407.         GOTO DONE
  408.         :360
  409.         FORMAT! A: /N:09 /T:40 %2 %3 %4
  410.         GOTO DONE
  411.         :12
  412.         FORMAT! A: /N:15 /T:80 %2 %3 %4
  413.         GOTO DONE
  414.         :720
  415.         FORMAT! B: /N:09 /T:80 %2 %3 %4
  416.         GOTO DONE
  417.         :144
  418.         FORMAT! B: /N:15 /T:80 %2 %3 %4
  419.         GOTO DONE
  420.         :DONE
  421.  
  422.         If your drives are different that the above, simply edit the 
  423.         lines, to the correct drive letter. Remember, 5¼ inch drives are 
  424.         360K and 1.2MB while 3½ inch drives are 720K and 1.44MB. Thus, 
  425.         if your drive A: is 3½ instead of B:, then simply change the 
  426.         above A:'s to B:'s and B:'s to A:'s !
  427.  
  428.  
  429.  
  430.         FREE File Viewer From DOS
  431.  
  432.         If you want a FREE file viewing utility, you have one already! 
  433.         Many of you already are aware of using the good old line of
  434.  
  435.                 TYPE filename | MORE
  436.  
  437.         Save your self some typing and create the following one line 
  438.         batch file calling it TYP.BAT
  439.  
  440.                 MORE < %1
  441.  
  442.         This results in the same output as the earlier one using the DOS 
  443.         command TYPE! The %1 will be replaced at execution time, by the 
  444.         specified file name, such as TYP MYFILE ! Of course, this 
  445.         feature does NOT support paging or scrolling features found in 
  446.         many good FileListing utilities. However, if you're just 
  447.         interested in viewing a file to see if it's worth keeping or 
  448.         printing this is fast and easy to use. To abort the scrolling, 
  449.         simply press <Ctrl>C or <Ctrl><Break>! To move from to the next 
  450.         video page, press any key!
  451.  
  452.  
  453.  
  454.         More Ram For Your Applications
  455.  
  456.         Here's a way to save 1K or more of application ram, if you are 
  457.         loading TSR's into ram from your AUTOEXEC batch file. The trick, 
  458.         is to arrange you startup commands efficiently. Put DOS commands 
  459.         that don't increase the size of the environment, such as CHKDSK, 
  460.         ECHO and BREAK at the beginning of AUTOEXEC. Now load your TSR 
  461.         applications, making sure to include the path names. This is 
  462.         done prior to setting the path or other environ variables such 
  463.         as COMSPEC. After loading your TSR's you can execute any command 
  464.         which will increase the environ size, such as PATH and PROMPT.
  465.  
  466.         The reason we can gain memory in this manner, is because each 
  467.         time an application is loaded, DOS gives the application a COPY 
  468.         of the ENVIRON area, which includes PATH settings, etc... If we 
  469.         start our TSR's prior to setting any ENVIRON variables, we will 
  470.         give a TSR a smaller ENVIRON area! In this way, if your ENVIRON 
  471.         space uses 200 bytes and you have 5 TSR applications you'll save 
  472.         1K byte!
  473.  
  474.  
  475.  
  476.         FOR POWER!
  477.  
  478.         The DOS batch command FOR, can invoke several commands on a 
  479.         single line, to speed up your batch files. Consider an AUTOEXEC 
  480.         batch file that has the following 3 lines.
  481.  
  482.                 PROMPT=$P$G
  483.                 TSR1
  484.                 TSR2
  485.  
  486.         DOS must access the disk 3 times to read those 3 commands. 
  487.         Instead, pack all 3 commands into 1 line, using FOR :
  488.  
  489.                 FOR %%F IN (PROMPT=$P$G TSR1 TSR2) DO %%F
  490.  
  491.         This single line batch command replaces the previous 3 lines! In 
  492.         this case, the FOR command takes each entry (space delimited) 
  493.         and substitutes them for the variable %%F. In this way, DOS will 
  494.         only need to access the disk 1 time to read the 3 commands, 
  495.         instead of the previous 3 times! The one restriction with this 
  496.         tip is that programs executed in this fashion, can NOT have an 
  497.         argument passed to them. Also, the FOR command interprets 
  498.         semicolons as delimiters, just as it does spaces, so, you can 
  499.         NOT include your PATH command in a FOR command.
  500.  
  501.  
  502.  
  503.         Batch Files That Count
  504.  
  505.         Use this counting routine in batch files to perform routine 
  506.         tasks, such as backups, that you want to execute at regular 
  507.         intervals. The batch file COUNT.BAT, for example, used in your 
  508.         AUTOEXEC.BAT file, will automatically run CHKDSK /F command 
  509.         every third time you reboot. COUNT.BAT creates a zero byte file 
  510.         and uses its name as the counter. Create the batch file, 
  511.         COUNT.BAT, then add the line CALL COUNT.BAT to your AUTOEXEC.BAT 
  512.         file.
  513.  
  514.                 ECHO OFF
  515.                 CLS
  516.                 IF NOT EXIST BOOT? GOTO NO
  517.                 FOR %%F IN (BOOT3 BOOT2 BOOT1) DO IF EXIST %%F GOTO %%F
  518.                 GOTO ERROR
  519.                 :NO
  520.                 TYPE >BOOT2
  521.                 GOTO END
  522.                 :BOOT3
  523.                 REN BOOT3 BOOT1
  524.                 CHKDSK /F
  525.                 GOTO END
  526.                 :BOOT2
  527.                 REN BOOT2 BOOT3
  528.                 GOTO END
  529.                 :BOOT1
  530.                 REN BOOT1 BOOT2
  531.                 GOTO END
  532.                 :ERROR
  533.                 ECHO A BOOT file already exists, please delete
  534.                 ECHO it and retry.
  535.                 :END
  536.  
  537.         When you execute COUNT.BAT, it checks for a file named BOOT? and 
  538.         branches to a label in the batch file, although most of the 
  539.         branching simply renames the BOOT? file to the next level, thus 
  540.         incrementing the counter. In the first pass, the BOOT2 file is 
  541.         created via the instructions at label NO. We make an initial 
  542.         file of BOOT2 because this will have been the first pass. Each 
  543.         additional pass thru the batch file, causes a high numbered 
  544.         BOOT? file to be created, by renaming a previous level. If 
  545.         during the first pass, a BOOT? file is discovered, other than 
  546.         the 3 BOOT? files we want, we branch to the ERROR label and 
  547.         instruct the user to delete it. You can perform tests on as many 
  548.         different branches as you wish. For example, you might count to 
  549.         10, running CHKDSK /F on count 5 and a back up on count 10. Just 
  550.         add additional BOOT? names in the line beginning with FOR, and 
  551.         additional labels after BOOT3 for the additional BOOT? 
  552.         functions. NOTE, the COUNT.BAT file is in the root directory 
  553.         with AUTOEXEC.BAT and BOOT? files.
  554.  
  555.  
  556.  
  557.         DOS 5.0 CHKDSK Meanings
  558.  
  559.         Many users are confused by the DOS 5.0 CHKDSK display. The 
  560.         following is a DOS 5.0 CHKDSK report for a PC with a 40MB hard 
  561.         drive, along with the meaning.
  562.  
  563.         33462272 bytes total disk space
  564.         57344 bytes in 5 hidden files    ────────┤ Hard disk space
  565.         172032 bytes in 74 directories           │ utilization in
  566.         29212672 bytes in 4921 user files        │ bytes
  567.         3975168 bytes available on disk
  568.  
  569.                                                  │ Disk space allocation
  570.                                                  │ units. An allocation
  571.                                                  │ unit is a group of
  572.         2048 bytes in each allocation unit  ─────┤ sectors that DOS
  573.         16339 total allocation units on dis      │ treats as a single
  574.         1941 available allocation units on disk  │ block. It represents
  575.                                                  │ the least amount of
  576.                                                  │ disk space DOS will
  577.                                                  │ allocate to a file.
  578.  
  579.                                                  │ Amount of convention-
  580.         655360 total bytes memory  ──────────────┤ al memory installed 
  581.         511984 bytes free                        │ and available. This
  582.                                                  │ memory is different
  583.                                                  │ from hard disk memory
  584.                                                  │ reported above.
  585.  
  586.         Allocation units are also called CLUSTERS.
  587.  
  588.         A hard drive is much like a floppy disk, except it can hold much 
  589.         more data, and can NOT be removed like a floppy. In addition, a 
  590.         hard is accessed faster than a floppy. RAM, is temporary 
  591.         storage, inside the computer, and goes away each time power is 
  592.         turned off, and must be restored each time your computer is 
  593.         turned back on. This process is called booting.
  594.  
  595.        
  596.  
  597.         Emergency Disks
  598.  
  599.         If you are backing up your system regularly, the following 
  600.         information will aid in getting you back up and running quickly. 
  601.         You will need to make a DOS boot disk (if you have an older 
  602.         machine it will be a 360K disk). To make a boot disk, place a 
  603.         new (un-formatted) disk, into drive A: and type "FORMAT A: /S" 
  604.         at your DOS prompt. This will create a bootable disk, with the 
  605.         DOS operating system on it. Now, put the following DOS utilities 
  606.         on this disk :
  607.  
  608.                 FDISK.EXE
  609.                 FORMAT.COM
  610.                 DEBUG.COM   (XT machines only)
  611.  
  612.         If the disk has room, place a copy of your backup program onto 
  613.         the disk (or just the restore portion). If your backup program 
  614.         will NOT fit onto this disk, then you will have to put it onto a 
  615.         separate disk. You might read your back up disk documentation to 
  616.         see if it suggests how to make an emergency restoral disk. Next, 
  617.         you will need a low level formatting program, such as Disk 
  618.         Manager, or for XT machines, you will need to place the DOS 
  619.         DEBUG.COM program on the emergency disk. Mark the disk(s), 
  620.         "Emergency Boot Disk(s)". Now, when your hard drive fails (all 
  621.         eventually do), you'll be able to restore the system. Simply 
  622.         repair or replace the hard drive, pull out your back up disks 
  623.         from your last backup and do the following.
  624.  
  625.                 1) Boot your system from the "Emergency Boot Disk"
  626.                 2) Start the lowlevel formatting program
  627.                 3) Run FDISK to partition the drive
  628.                 4) Run Format to format the drive
  629.                 5) Run your backup programs restore file option
  630.  
  631.         If you are restoring an XT, then replace step two above with :
  632.  
  633.                 2) Start DEBUG, and enter GC800:5 at the "-" prompt
  634.  
  635.         This will lowlevel format an XT machine.
  636.  
  637.         If you backup regularly, getting things going will be much 
  638.         faster and easier than with out regular backups. If you are 
  639.         attempting to restore you system without a backup set, you'll 
  640.         have to have original disks for each application and reinstall 
  641.         each! If you had data, on the broken drive, which must be 
  642.         recovered, you'll have to lay out a big chunk of money to a data 
  643.         recovery service to get the data off the broken drive (and there 
  644.         are NO guarantees the data can all be recovered). By backing up 
  645.         regularly, you need only perform the above 5 steps, with a time 
  646.         of around 2 hours to several hours. If you don't, it may take 
  647.         you months to recover the data you lost!
  648.  
  649.  
  650.  
  651.         Directory Navigation Shortcuts
  652.  
  653.         Save yourself time and keystrokes, by using these directory 
  654.         navigation shortcuts.
  655.  
  656.         If you are in a directory \WP\FILES and wish to go to \WP\DOCS 
  657.         you'd type these lines.
  658.  
  659.                 CD \
  660.                 CD WP
  661.                 CD DOCS
  662.  
  663.         These three lines can be replaced with one:
  664.  
  665.                 CD ..\DOCS
  666.  
  667.         DOS supplies us with a directory entry "..", which references 
  668.         the previous directory level. By Type "CD .." we go back one 
  669.         level. By adding the "\DOCS" to the tail of this string, we can 
  670.         navigate the entire change in one command. First, DOS moves back 
  671.         the one level (now in \WP), then DOS moves forward one level to 
  672.         the directory DOCS (now in \WP\DOCS).
  673.  
  674.         Another interesting aspect of this function is in navigating 
  675.         multi-level directories. If you are in the following directory :
  676.  
  677.         \WORD\FILES\LETTERS\APRIL
  678.  
  679.         And wanted to go to the directory \WORD\FILES, you'd normally 
  680.         type two lines : 
  681.  
  682.                 CD \
  683.                 CD WORD\FILES
  684.  
  685.         Or even the single line "CD \WORD\FILES" to combine the two 
  686.         commands into one. There is a shorter way, simply type the 
  687.         following : CD ..\..     You're there !
  688.  
  689.  
  690.  
  691.         Batch File CALLS Using DOS Before Version 3.3
  692.  
  693.         In DOS 3.3 and up, there is a new command "CALL", which will 
  694.         execute another batch file, then return to the original batch 
  695.         file, starting at the line after the "CALL". For instance :
  696.  
  697.                 ECHO OFF
  698.                 CLS
  699.                 CALL AUTO
  700.                 MENU
  701.  
  702.         Would call the batch file "AUTO", then return an start a MENU. 
  703.         This function can be emulated using earlier DOS versions, and 
  704.         without executing another COMMAND.COM shell! To do this involves 
  705.         a little forethought and planning. Taking the above example, we 
  706.         create a batch file, adding a couple of lines.
  707.  
  708.                 ECHO OFF
  709.                 IF %RETURN%*==* GOTO START
  710.                 GOTO %RETURN%
  711.                 :START
  712.                 CLS
  713.                 SET RETURN=RETURN
  714.                 AUTO AUTOEXEC
  715.                 :RETURN
  716.                 MENU
  717.  
  718.         After our ECHO OFF (halt echoing), we check to see if the 
  719.         variable (DOS Environ) is set, and if so we assume it is set to 
  720.         a label in the current batch file, AUTOEXEC. If there is NOT a 
  721.         label, we branch to the normal entry and clear the display. 
  722.         However, if RETURN has a value, we branch to that label, 
  723.         assuming the label is in the current batch file AUTOEXEC. After 
  724.         clearing the screen, we set our return label to RETURN and start 
  725.         the AUTO batch file.
  726.  
  727.  
  728.         The batch file AUTO will then have these lines:
  729.  
  730.                 {your batch file commands}
  731.                 %1%
  732.  
  733.         The last line, returns control to the original batch file. The 
  734.         AUTOEXEC after AUTO in our first batch file, is will replace the 
  735.         %1 parameter ! When we return, we will automatically return to 
  736.         the label "RETURN" in the first batch file, then we can start 
  737.         the menu.
  738.  
  739.  
  740.  
  741.         Nested Batch Files Save Time
  742.  
  743.         If you want to beef up your batch files, use the DOS COMMAND /C 
  744.         and CALL commands, to create nested batch files that call up one 
  745.         batch file from within another. Without these commands, an 
  746.         executing batch file that summons another will execute the 
  747.         second file and return to a DOS prompt, without completing the 
  748.         original batch file. With DOS 3.3 and higher, CALL, an internal 
  749.         command, can be used to invoke a second batch file, like this :
  750.  
  751.                 DATE
  752.                 CALL TELECOM
  753.                 WP
  754.  
  755.         In this example, which loads a communications program, then a 
  756.         wordprocessor, the CALL command invokes the TELECOM batch file 
  757.         and returns control to the original batch file, which then 
  758.         executes the WP command. If you are using DOS earlier than 3.3, 
  759.         then a different method must be used. The following batch 
  760.         example will perform as the above, for DOS versions earlier than 
  761.         3.3 :
  762.  
  763.                 DATE
  764.                 COMMAND /C TELECOM
  765.                 WP
  766.  
  767.         This approach does have disadvantages. Unlike the DOS 3.3+ call 
  768.         command, COMMAND /C loads another copy of COMMAND.COM to execute 
  769.         the second batch file. When COMMAND.COM terminates, it passes 
  770.         control back to the first batch file, which then executes the 
  771.         final instruction WP. Because each nested batch file has it's 
  772.         own copy of COMMAND.COM , memory usage will be high, and the 
  773.         number of nested calls will be much less than later DOS versions 
  774.         with the CALL command. You can use the CALL and COMMAND /C 
  775.         approach, even from an AUTOEXEC batch file.
  776.  
  777.  
  778.        Tutorial finished. Have you registered PC-Learn to receive your
  779.        bonus disks? Registration is encouraged. Shareware works on the
  780.        honor system! Send $25 to Seattle Scientific Photography, 
  781.        Department PCL6, PO Box 1506, Mercer Island, WA 98040. Latest 
  782.        version of PC-Learn and two bonus disks shipped promptly!
  783.  
  784.  
  785.  
  786.